<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="vtc" uri="/ls-trade-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="/common/meta.jsp"%>
<title>VTC - Holistic category - HPP</title>
<%@ include file="/common/css_js.jsp"%>
<script>
function selectProgrammes(){
	var cb=$("#programmes");
	if(cb.attr("checked")==true){
		var cbRoleCodes=document.getElementsByName("selectProgrammeList")
		for(i=0;i<cbRoleCodes.length;i++){
			cbRoleCodes[i].checked=true;
		}
	}else{
		var cbRoleCodes=document.getElementsByName("selectProgrammeList")
		for(i=0;i<cbRoleCodes.length;i++){
			cbRoleCodes[i].checked=false;
		}
	}
}

function savePhaseOutProgramme(){
	var hasAttribute = false;
	var cbRoleCodes=document.getElementsByName("selectProgrammeList")
	for(i=0;i<cbRoleCodes.length;i++){
		if(cbRoleCodes[i].checked==true){
			hasAttribute = true;
			break;
		}
	}
	if(!hasAttribute){
		if(confirm("Please select one Programme at least.")){
			return false;
		}
	}else{
		$("#phaseOutForm").attr('action', 'selectedPhraseOut!save.action?no-decorate=0');
		$("#phaseOutForm").submit();
		window.top.catForm.location="categoryProgrammeAttribute!list.action?no-decorate=0&categoryNodeId=<s:property value='categoryNodeId' />&categoryId=<s:property value='categoryId' />&categoryNodeType=<s:property value='categoryNodeType'/>";
		
		CE.close();
	}
}
</script>
<body>
<div class="bodyBlank" >
 <form name="phaseOutForm" id="phaseOutForm" method="post" action="selectedPhraseOut!turnToPhaseOutProgrammePage.action?no-decorate=0&categoryNodeId=<s:property value='categoryNodeId'/>&categoryNodeType=<s:property value='categoryNodeType'/>&categoryId=<s:property value='categoryId'/>&treeType=<s:property value='treeType'/>">
  <div class="padding" > <!-- InstanceBeginEditable name="content" -->
    <div class="bodyBlank2" >
      <div class="pageTitle2" ><s:property value="categoryNodeName" /> - View Programme List </div>
      <div class="sListBorder" >
        <div class="sList" >
       
					<s:hidden name="categoryNodeId" id="categoryNodeId"
						value="%{categoryNodeId}"></s:hidden>
					<s:hidden name="categoryNodeType" id="categoryNodeType"
						value="%{categoryNodeType}" />
					<s:hidden name="treeType" id="treeType" value="%{treeType}"/>
					<s:hidden id="categoryId" name="categoryId"
					value="%{categoryId}"></s:hidden>
          <table width="100%" class="sTable" cellpadding="0" cellspacing="0" border="0" >
            <tr>
            	<td class="sTh checkbox"><input class="inputCheckbox"
								type="checkbox" id="programmes" name="programmes"
								onclick="selectProgrammes()" />
							</td>
              <td class="sTh" >Programme Code </td>
              <td class="sTh" >Programme Title</td>
              <td class="sTh" >Programme Status </td>
            </tr>
            <s:if test="%{page!=null&&page.result!=null&&page.result.size()!=0}">
            <s:iterator value="page.result" var="programme">
					<tr class="sRow2">
						<td class="sCell"><s:checkbox name="selectProgrammeList"
										value="0" fieldValue="%{#programme.id}" />
								</td>
						<td class="sCell"><s:property value="#programme.code" /></td>
						<td class="sCell"><s:property value="#programme.titleLong" /></td>
						<td class="sCell"><s:property value="#programme.status" /></td>
					</tr>
			</s:iterator>
            </s:if>
          </table>
         
        </div>
        <vtc:paging page="%{page}"></vtc:paging>
        <div class="btnSet btnSetTypeB">
        <div class="left" >
        
           <div class="button">
				<div class="left">
					<div class="right">
						<input class="inputButton" type="button" id="saveBut" name=""
							value="&nbsp;Select&nbsp;" onclick="savePhaseOutProgramme()" />
					</div>
				</div>
			</div>
          <div class="button" >
            <div class="left" >
              <div class="right" >
                <input class="inputButton" type="button" id="" name="" value="Close" onclick="CE.close()" />
              </div>
            </div>
          </div>
        </div>
      </div>
      </div>
    </div>
    <!-- InstanceEndEditable --> </div>
     </form>
</div>
</body>